﻿@model EQueue.AdminWeb.Models.ClusterConsumerListViewModel
@{
    ViewBag.Title = "ConsumerList";
}
<div>
    @using (Html.BeginForm("ConsumerList", "Home", new { clusterName = ViewBag.ClusterName }, FormMethod.Post, null, new { @class = "form-inline", role = "form" }))
    {
        <div class="form-group">
            <label class="sr-only" for="ClusterName"></label>
            @Html.TextBoxFor(m => m.ClusterName, new { @class = "form-control", placeholder = "ClusterName" })
        </div>
        <div class="form-group">
            <label class="sr-only" for="Group"></label>
            @Html.TextBoxFor(m => m.Group, new { @class = "form-control", placeholder = "Group" })
        </div>
        <div class="form-group">
            <label class="sr-only" for="Topic"></label>
            @Html.TextBoxFor(m => m.Topic, new { @class = "form-control", placeholder = "Topic" })
        </div>
        <button type="submit" class="btn btn-default">查询</button>
    }
    <table class="table table-striped">
        <thead>
            <tr>
                <th width="10%" class="vertical-center">
                    ConsumerGroup
                </th>
                <th width="20%" class="vertical-center">
                    ConsumerId
                </th>
                <th width="10%" class="vertical-center">
                    BrokerName
                </th>
                <th width="10%" class="vertical-center">
                    Topic
                </th>
                <th width="10%" class="text-center vertical-center">
                    QueueId
                </th>
                <th width="10%" class="text-center vertical-center">
                    CurrentOffset
                </th>
                <th width="10%" class="text-center vertical-center">
                    消费进度
                </th>
                <th width="10%" class="text-center vertical-center">
                    堆积数
                </th>
                <th width="10%" class="text-center vertical-center">
                    CacheCount
                </th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model.ConsumerList)
            {
                <tr>
                    <td class="vertical-center">
                        @item.ConsumerInfo.ConsumerGroup
                    </td>
                    <td class="vertical-center">
                        @item.ConsumerInfo.ConsumerId
                    </td>
                    <td class="vertical-center">
                        @Html.ActionLink(@item.BrokerInfo.BrokerName, "Index", "Broker", new { clusterName = ViewBag.ClusterName, brokerName = @item.BrokerInfo.BrokerName }, null)
                    </td>
                    <td class="vertical-center">
                        @item.ConsumerInfo.Topic
                    </td>
                    <td class="text-center vertical-center">
                        @item.ConsumerInfo.QueueId
                    </td>
                    <td class="text-center vertical-center">
                        @item.ConsumerInfo.QueueCurrentOffset
                    </td>
                    <td class="text-center vertical-center">
                        @item.ConsumerInfo.ConsumedOffset
                    </td>
                    <td class="text-center vertical-center">
                        @item.ConsumerInfo.QueueNotConsumeCount
                    </td>
                    <td class="text-center vertical-center">
                        @item.ConsumerInfo.ClientCachedMessageCount
                    </td>
                </tr>
            }
        </tbody>
    </table>
</div>
